package com.controller;

import com.javabean.User;
import com.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

@Controller
public class UserController {
    @Autowired
    UserService userService;

    @RequestMapping("/all")
    public String all(HttpServletRequest request){
        List<User> all = userService.findAll();
        request.setAttribute("data", all);
        return "all";
    }
}